package cn.yuanqiao.archive.liyong.mapper;

import cn.yuanqiao.archive.liyong.domain.AppointmentForm;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 预约单mapper
 *
 * @ProjectName: cn.yuanqiao.archive.liyong.mapper
 * @ClassName: AppointmentFormMapper
 * @Author: lenovo
 * @Description: hbWang
 * @Date: 2024/10/29 17:07
 * @Version: 1.0
 **/
public interface AppointmentFormMapper {
    /**
     * 查询【预约单】
     *
     * @param id 【预约单】主键
     * @return 【预约单】
     */
    public AppointmentForm selectAppointmentFormByID(@Param("id") String id, @Param("tableName") String tableName);

    /**
     * 拼接sql查询
     *
     * @param field
     * @param sql
     * @return
     */
    List<Map<String, Object>> selectList(@Param("field") String field, @Param("sql") String sql);

    List<String> selectListString(@Param("field") String field, @Param("sql") String sql);

    /**
     * 查询【预约单】列表
     *
     * @param appointmentForm 【预约单】
     * @return 【预约单】集合
     */
    public List<AppointmentForm> selectAppointmentFormList(AppointmentForm appointmentForm);

    public List<AppointmentForm> selectAppointmentFormListUser(AppointmentForm appointmentForm);

    /**
     * 根据用户id查询【预约单】列表
     *
     * @return 【预约单】集合
     */
    public List<AppointmentForm> selectAppointmentFormListByUserId(@Param("userId") String userId, @Param("tableName") String tableName);

    /**
     * 根据档案id查询【预约单】信息
     *
     * @return 【预约单】集合
     */
    public int selectAppointmentFormByDaId(@Param("daId") String daId, @Param("tableName") String tableName,@Param("userId") String userId);

    /**
     * 根据档案id查询预约单信息
     *
     * @param daId
     * @param tableName
     * @return
     */
    public List<AppointmentForm> selectAppointmentFormByDaIdList(@Param("daId") String daId, @Param("status") String status,
                                                                 @Param("tableName") String tableName,@Param("userId") String userId,@Param("borrowTime") String borrowTime);

    /**
     * 根据用户id查询未提交【预约单】列表
     *
     * @param userId
     * @param tableName
     * @return
     */
    public List<AppointmentForm> selectAppointmentFormBycreateId(@Param("userId") Long userId, @Param("tableName") String tableName);

    /**
     * 新增【预约单】
     *
     * @param appointmentForm 【预约单】
     * @return 结果
     */
    public int insertAppointmentForm(AppointmentForm appointmentForm);

    /**
     * 修改【预约单】
     *
     * @param appointmentForm 【预约单】
     * @return 结果
     */
    public int updateAppointmentForm(AppointmentForm appointmentForm);

    /**
     * 删除【预约单】
     *
     * @param id 【预约单】主键
     * @return 结果
     */
    public int deleteAppointmentFormByID(@Param("id") String id, @Param("tableName") String tableName);

    /**
     * 更新sql
     *
     * @param sql
     * @return
     */
    int updateTableData(@Param("sql") String sql);

    /**
     * 批量删除【预约单】
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteAppointmentFormByIDs(@Param("ids") String[] ids, @Param("tableName") String tableName);

    /**
     * 创建预约单表
     *
     * @param tableName
     * @return
     */
    int createAppointmentForm(@Param("tableName") String tableName);
}
